package com.weaver.openapi.service;

import com.weaver.openapi.pojo.eb.params.page.*;
import com.weaver.openapi.util.*;
import java.util.*;
import cn.hutool.http.*;
import com.alibaba.fastjson.*;
import com.weaver.openapi.pojo.eb.res.page.*;

public class EbPageService
{
    public static EbPageConfigResultVo getConfig(final EbPageVo ebPageVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/x-www-form-urlencoded");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", ebPageVo.getAccessToken());
        paramMap.put("userid", ebPageVo.getUserid());
        paramMap.put("pageId", ebPageVo.getPageId());
        paramMap.put("compId", ebPageVo.getCompId());
        final String resJson = ((HttpRequest)HttpRequest.get(host + "/api/ebuilder/coms/common/getConfig").form((Map)paramMap).headerMap((Map)headers, true)).execute().body();
        return (EbPageConfigResultVo)JSONObject.parseObject(resJson, (Class)EbPageConfigResultVo.class);
    }
    
    public static EbPageNavResultVo getNavData(final EbPageVo ebPageVo, String host, final Map<String, String> headers) {
        host = HostUtil.beforeRequestCheckHeaders(host, headers, "application/json");
        final Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("access_token", ebPageVo.getAccessToken());
        paramMap.put("userid", ebPageVo.getUserid());
        paramMap.put("pageId", ebPageVo.getPageId());
        paramMap.put("compId", ebPageVo.getCompId());
        final String resJson = ((HttpRequest)HttpRequest.post(host + "/api/ebuilder/coms/navmenu/getData").body(JSONObject.toJSONString((Object)paramMap)).headerMap((Map)headers, true)).execute().body();
        return (EbPageNavResultVo)JSONObject.parseObject(resJson, (Class)EbPageNavResultVo.class);
    }
}
